<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Model;

class UserCoinClue extends Model
{
    use HasDateTimeFormatter;

    protected $table = 'user_coin_clue';

    protected $fillable = [
        'user_id',
        'coin_id',
        'coin_clue_id',
        'amount',
        'longitude',
        'latitude',
        'radius'
    ];

    const STATUS_DONE = 1;
    const STATUS_NO_DONE = 0;

    public function coin()
    {
        return $this->belongsTo(Coin::class, 'coin_id', 'id');
    }

    public function coinClue()
    {
        return $this->belongsTo(CoinClue::class, 'coin_clue_id', 'id');
    }
}
